import { Custom, CustomEnum } from 'custom/index'

export default class ListPageTabs extends Custom {
  public static name: CustomEnum = 'ListPageTabs';

  protected static emits = {
    'tab-change': 'getData'
  }

  private _default
  public getDefault() {
    return this._default
  }
  public setDefualt(value: any) {
    this._default = value
    return this
  }

  public setProp(prop: string) {
    this._props.prop = prop
    return this
  }
  public getProp() {
    return this._props.prop
  }

  addTab(tab) {
    if (!this._props.tabs) {
      this._props.tabs = []
    }
    this._props.tabs.push(tab)
    return this
  }

  // protected static props = {
  //   page: {
  //     type: Object,
  //     default: () => ({})
  //   }
  // }

  // protected static emits = {
  //   changePage: 'changePage'
  // }

  end() {
    return this.upto('ListPage')
  }
}
